﻿var txtKeyword = document.getElementById("txtKeyword");
var btnSubmit = document.getElementById("btnSubmit");
var nulltext = "请输入您要查找的职位";

txtKeyword.value = nulltext;
txtKeyword.onfocus = function() {
    if (txtKeyword.value == nulltext) {
        txtKeyword.style.color = "#000";
        txtKeyword.value = "";
    }
}
txtKeyword.onblur = function() {
    if (txtKeyword.value == "") {
        txtKeyword.style.color = "#c7c7c7";
        txtKeyword.value = nulltext;
    }
}
txtKeyword.onkeydown = function() {
    if ((event.ctrlKey && event.keyCode == 13) || event.keyCode == 13)
        Submit();
}
btnSubmit.onclick = function() {
    Submit();
}

function Submit() {
    if (txtKeyword.value == nulltext) txtKeyword.value = "";
    if (txtKeyword.value == "") {
        alert("关键字不能为空！")
        return false;
    }
    if (document.getElementById("radKeyWordType0").checked)
        radKey = 0;
    else
        if (document.getElementById("radKeyWordType1").checked)
        radKey = 1;
    else
        radKey = 2;

    location = "#?keyWord=" + escape(txtKeyword.value) + "&keyWordType=" + radKey + "&searchType=advSearch";
}